/***********************************************
 This file is part of redia-bapps-main-ios.
 
 Copyright (c) 2015 Redia A/S
 
 Redia-bapps-main-ios is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 redia-bapps-main-ios is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with redia-bapps-main-ios.  If not, see <http://www.gnu.org/licenses/>.
 
 *********************************************** */

//
//  BALibrarySettings.h
//  redia-bapps-ios
//
//  Created by Henrik Lynbech on 14/08/13.
//  Copyright (c) 2013 redia. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "BALibrary.h"

#define BA_LIBRARIAN_SEARCH_FILTER_DEFAULT_FREE_TEXT @"default"


typedef enum BATypeIconContextKinds {
    BATypeIconContextSearchResultsList,
    BATypeIconContextSearchFilterButton,
    BATypeIconContextBAppsMaterialView,
    BATypeIconContextLibrarianSearchFilters,
    BATypeIconContextIPadSearchColumnHeader
} BATypeIconContext;

typedef enum BALibrarySettingsLogoTypeKinds {
    BALibrarySettingsLogoUrlTypeDefault,
    BALibrarySettingsLogoUrlTypeLogin,
} BALibrarySettingsLogoType;

@interface BALibrarySettings : NSObject

SINGLETON_DECL_GCD(BALibrarySettings)

/**
 The object that describes the settings for the currently selected
 library.
 */
@property (strong, nonatomic) BALibrary *libraryObject;

/**
 Should be called whenever the main library object has changed,
 i.e., when another library has been selected.
 */
- (void)libraryObjectChanged;

//deprecated: @property (nonatomic) BOOL isCurrentlyInLibrarianMode;

@property (nonatomic, strong, readonly) NSArray* branches;

-(BOOL)isLibrarianModeAllowed;
-(BOOL)isUserLibraryModeAllowed;
-(BOOL)isImfEnabled;
-(BOOL)isScannerEnabled;

-(NSDictionary*)getSearchFilterTypes;

-(NSString*)getDefaultMaterialTypeFilter;

-(UIImage*)getIconForMaterialType:(NSString*)materialTypeText contextIdentifier:(BATypeIconContext)context color:(UIColor*)color;

/**
 Get the customer-specific normal (general) interface color
 */
-(UIColor*)getCustomerColorNormal;

/**
 Get the customer-specific darker interface color
 */
-(UIColor*)getCustomerColorDark;

/**
 Use this function to use cached imaged that are multiplied by a specific
 color. This is useful to avoid duplicating the same image pixels several
 times in memory because of the coloring.
 */
-(UIImage*)getCachedImageNamed:(NSString*)filename multiplyWithColor:(UIColor*)color;

/**
 Shorthand function to color an image to the normal
 customer color.
 
 @see getCachedImageNamed:multiplyWithColor:
 */
-(UIImage*)getCachedNormalCustomerColoredImageNamed:(NSString*)filename;

/**
 Shorthand function to color an image to the dark
 customer color.
 
 @see getCachedImageNamed:multiplyWithColor:
 */
-(UIImage*)getCachedDarkCustomerColoredImageNamed:(NSString*)filename;

-(NSString*)getLogoUrlStringForType:(BALibrarySettingsLogoType)logoType;

//deprecated: -(void)fetchBranchesListIfNeeded;

@end
